package com.conv.shop.business.service;

import com.conv.shop.business.domain.Address;
import com.conv.shop.business.domain.AddressExample;
import com.conv.shop.business.mapper.AddressMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class AddressService {
    @Resource
    private AddressMapper addressMapper;

    /**
     * 获取用户地址信息
     * @param consumerId
     * @return Address
     */

    public Address getAddress(Integer consumerId) {
        AddressExample addressExample = new AddressExample();
        addressExample.createCriteria().andConsumerIdEqualTo(consumerId);
        return addressMapper.selectByExample(addressExample).get(0);
    }
}
